<!--
 * @Author: your name
 * @Date: 2021-09-06 09:32:57
 * @LastEditTime: 2021-09-06 16:10:58
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup\5-javascript\day11\1-Document.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="app1">
        div.app1
    </div>
    <div class="app2">
        div.app2
    </div>
    <div class="app3">
        div.app3
    </div>
    <!-- <div id="app">
        div#app1
    </div>
    <div id="app">
        div#app2
    </div> -->
    <!-- <form action="get" name="app" id="app"></form> -->
    <li>123</li>
    <li>123</li>
    <div name="myDiv">
        name-div
    </div>
    <a>没有href</a>
    <a href="http://www.baidu.com">百度一下</a>
    <a href="http://www.baidu.com">百度一下</a>
    <form action=""></form>
</body>
<script>
    //通过类名查找
    var classApp = document.getElementsByClassName("app");
    console.log(classApp);
    //通过id查找
    var idApp = document.getElementById("App");
    console.log(idApp);
    //通过标签名查找
    var myDivs = document.getElementsByTagName("div");
    console.log(myDivs);
    var li = document.getElementsByTagName("li");
    console.log(li);
    //通过name属性查找
    var myDivs = document.getElementsByName("myDiv");
    console.log(myDivs);
    console.log(document); //获取整个内容
    console.log(document.body); //获取body里的所有内容
    console.log(document.links); //获取文档中带有herf属性的a元素
    console.log(document.forms); // 获取所有的form表单对象
</script>

</html>